﻿//===================================================================
// 西交投.NET产品框架 2019 版权所有     
//===================================================================
using System;
using System.ComponentModel.DataAnnotations;
using XCI.Core;

namespace XCI.Sys.Model
{
    /// <summary>
    /// 系统操作日志
    /// </summary>
    [ApiModel(Caption = "系统操作日志")]
    public class SysOperateLog
    {
        /// <summary>
        /// 日志主键
        /// </summary>
        [Display(Name = "日志主键")]
        [ApiModelProperty(PrimaryKey = true)]
        public string Id { get; set; }

        /// <summary>
        /// 模块
        /// </summary>
        [Display(Name = "模块")]
        public string Module { get; set; }

        /// <summary>
        /// 操作状态 [true-成功, false-失败]
        /// </summary>
        [Display(Name = "操作状态")]
        public bool? Status { get; set; }

        /// <summary>
        /// 操作消息
        /// </summary>
        [Display(Name = "操作消息")]
        public string Msg { get; set; }

        /// <summary>
        /// 错误消息
        /// </summary>
        [Display(Name = "错误消息")]
        public string ErrorMsg { get; set; }

        /// <summary>
        /// 请求地址
        /// </summary>
        [Display(Name = "请求地址")]
        public string ReqUrl { get; set; }

        /// <summary>
        /// 请求方法
        /// </summary>
        [Display(Name = "请求方法")]
        public string ReqMethod { get; set; }

        /// <summary>
        /// 请求参数
        /// </summary>
        [Display(Name = "请求参数")]
        public string ReqParam { get; set; }

        /// <summary>
        /// 耗时(毫秒数)
        /// </summary>
        [Display(Name = "耗时(毫秒数)")]
        public int? CostTime { get; set; }

        /// <summary>
        /// 耗时描述
        /// </summary>
        [Display(Name = "耗时描述")]
        public string CostTimeName { get; set; }

        /// <summary>
        /// 操作方法
        /// </summary>
        [Display(Name = "操作方法")]
        public string ExecuteMethod { get; set; }

        /// <summary>
        /// 执行参数信息
        /// </summary>
        [Display(Name = "执行参数信息")]
        public string ExecuteParam { get; set; }

        /// <summary>
        /// 执行结果信息
        /// </summary>
        [Display(Name = "执行结果信息")]
        public string ExecuteResult { get; set; }

        /// <summary>
        /// 应用主键
        /// </summary>
        [StringLength(100, ErrorMessage = "应用主键长度不能超过100")]
        [Display(Name = "应用主键")]
        public string AppId { get; set; }

        /// <summary>
        /// 应用名称
        /// </summary>
        [StringLength(100, ErrorMessage = "应用名称长度不能超过100")]
        [Display(Name = "应用名称")]
        public string AppName { get; set; }

        /// <summary>
        /// IP地址
        /// </summary>
        [Display(Name = "IP地址")]
        public string Ip { get; set; }

        /// <summary>
        /// IP地点
        /// </summary>
        [Display(Name = "IP地点")]
        public string IpLocation { get; set; }

        /// <summary>
        /// 浏览器
        /// </summary>
        [Display(Name = "浏览器")]
        public string Browser { get; set; }

        /// <summary>
        /// 操作系统
        /// </summary>
        [Display(Name = "操作系统")]
        public string Os { get; set; }

        /// <summary>
        /// 浏览器标识
        /// </summary>
        [Display(Name = "浏览器标识")]
        public string UserAgent { get; set; }

        /// <summary>
        /// 操作人主键
        /// </summary>
        [Display(Name = "操作人主键")]
        public string OperateUserId { get; set; }

        /// <summary>
        /// 操作人姓名
        /// </summary>
        [Display(Name = "操作人姓名")]
        public string OperateUserName { get; set; }

        /// <summary>
        /// 操作时间
        /// </summary>
        [Display(Name = "操作时间")]
        public DateTime? OperateDateTime { get; set; }

        /// <summary>
        /// 复制对象
        /// </summary>
        public SysOperateLog Clone()
        {
            return (SysOperateLog)MemberwiseClone();
        }
    }
}
